/**
 * @Title: ItemInfoVO
 * @Package cn.com.yiqi.wsc.Ro
 * @Description: TODO
 * Copyright: Copyright (c) 2016
 * Company: 成都壹柒互动科技有限公司
 * @author 会员系统组-林威
 * @date 2017/2/22 12:05
 * @version V1.0
 */
package cn.com.yiqi.wsc.Ro;

import org.apache.commons.lang3.StringUtils;

import java.math.BigDecimal;

/**
 *
 *@ClassName: ItemInfoVO
 * Description: TODO
 * @author 会员系统组-林威
 * @date 2017/2/22 12:05
 *
 */
public class ItemInfoVO {

    private Integer itemId;
    private String imgUrl;
    private String name;
    private BigDecimal oldPrice;
    private BigDecimal nowPrice;
    /**已售量*/
    private Integer soldCount;
    private String vipStr;

    /**支付类型1现金 2 积分*/
    private Integer payType;
    private Integer costPoint;
    /**积分价格*/
    private Integer pointPrice;

    public Integer getPointPrice() {
        return pointPrice;
    }

    public void setPointPrice(Integer pointPrice) {
        this.pointPrice = pointPrice;
    }

    public Integer getCostPoint() {
        return costPoint;
    }

    public void setCostPoint(Integer costPoint) {
        this.costPoint = costPoint;
    }

    public String getVipStr() {
        return vipStr;
    }

    public void setVipStr(String vipStr) {
        this.vipStr = vipStr;
    }

    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public Integer getSoldCount() {
        return soldCount;
    }

    public void setSoldCount(Integer soldCount) {
        this.soldCount = soldCount;
    }

    public Integer getItemId() {
        return itemId;
    }

    public void setItemId(Integer itemId) {
        this.itemId = itemId;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public BigDecimal getOldPrice() {
        return oldPrice;
    }

    public void setOldPrice(BigDecimal oldPrice) {
        this.oldPrice = oldPrice;
    }

    public BigDecimal getNowPrice() {
        return nowPrice;
    }

    public void setNowPrice(BigDecimal nowPrice) {
        this.nowPrice = nowPrice;
    }

    public void init() {
        String []str = vipStr.split(":");
        if(str[1].equalsIgnoreCase("d")){
            vipStr = str[0]+"天";
        }else if(str[1].equalsIgnoreCase("w")){
            vipStr = str[0]+"周";
        }else if(str[1].equalsIgnoreCase("m")){
            vipStr = str[0]+"月";
        }else if(str[1].equalsIgnoreCase("y")){
            vipStr = str[0]+"年";
        }

    }

    public void initUrl(String url) {
        if(StringUtils.isNotEmpty(imgUrl)){
            imgUrl = url + "/" + imgUrl;
        }
    }
}
